<?php
class Asset_class extends Admin_Controller
{
	public function __construct()
	{
		parent::__construct();
		$this->load->model('asset_class_model');
	}
	
	public function index()
	{
		$data['result'] = $this->asset_class_model->get();
		$data['pagination'] = $this->asset_class_model->pagination();
		$this->template->build('asset_class/index', $data);
	}
	
	public function form($id = NULL)
	{
		$data['rs'] = $this->asset_class_model->get_row($id);
		$this->template->build('asset_class/form', $data);
	}
	
	public function save()
	{
		if($_POST)
		{
			$this->asset_class_model->save($_POST);
			set_notify('success', lang('save_data_complete'));
		}
		redirect('asset/asset_class');
	}
	
	public function delete($id)
	{
		$this->asset_class_model->delete($id);
		set_notify('success', lang('delete_data_complete'));
		redirect('asset/asset_class');
	}
}